<?php

$arr = [45,4,54,5,234,5,34543];


作业：

// 1 随机产生7个不重复数（1-49）;
// 2 找出数组中的最大值 

// 索引数组

// $arr[0] = 89;
// $t = 0;
// for ($i=0; $i <count($arr) ; $i++) { 
// 	$t +=$arr[$i];
// }
// $t = 0;

// foreach ($arr as  $v) {
// 	$t += $v;
// }

// var_dump($t);

// $arr = [456,456,456,[4,7645,6,456,45,6,45]];


// echo $arr[3][3];

$arr = ['小明',18925139194,11364400,18,'男'];


var_dump($arr);

// 关联数组
// 
$arr = [
	[
		'name'=>'小明',
		'phone'=>18925139194,
		'qq'=>11366400,
		'age'=>18,
		'sex'=>'男'
	],
	[
		'name'=>'小红',
		'phone'=>18925139194,
		'qq'=>11366400,
		'age'=>18,
		'sex'=>'女'
	]
];

var_dump($arr);
?>

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body>
	<table border="1">
		<tr>
			<td>姓名</td>
			<td>手机</td>
			<td>qq</td>
			<td>年龄</td>
			<td>性别</td>
		</tr>
		<?php foreach ($arr as $k => $row): ?>
			<tr>
				<td><?php echo $row['name']; ?></td>
				<td><?php echo $row['phone']; ?></td>
				<td><?php echo $row['qq']; ?></td>
				<td><?php echo $row['age']; ?></td>
				<td><?php echo $row['sex']; ?></td>
			</tr>
			
		<?php endforeach ?>
		
	</table>
</body>
</html>

